package com.mida.dms.knw.util.vo;

public enum DataType {
	
	VARCHAR("string","VARCHAR2","VARCHAR","VARCHAR"),
	DATE("date","TIMESTAMP","datetime","datetime"),
	BIGINT("int","NUMBER","INT","INT");
	
	DataType(String type, String orcaletype, String mysqltype,String sqlservertype) {
		this.type = type;
		this.orcaletype = orcaletype;
		this.mysqltype = mysqltype;
		this.sqlservertype = sqlservertype;
	}
	String type,orcaletype,mysqltype,sqlservertype;
	
	
	public static String getValue(String type,String dbType) {
		for (DataType t : DataType.values()) {
			if(t.type.equals(type)) {
				switch (dbType) {
					case "mysql":return t.mysqltype;
					case "oracle":return t.orcaletype;
					case "sqlserver":return t.sqlservertype;
				}
			}
		}
		return null;
	}
	
//	public static void main(String[] args) {
//		System.out.println(DataType.getValue("string", "oracle"));
//	}
}
